<!DOCTYPE HTML>
<html lang="utf-8">
<head>
<meta charset="utf-8">
<title>驾车宝典-${viewMember.nickName!}的话题</title>
<link href="${ctx}/styles/group.css" rel="stylesheet" type="text/css">
<link href="${ctx}/styles/user.css" rel="stylesheet" type="text/css">
<link href="${ctx}/styles/userPanel.css" rel="stylesheet" type="text/css">
<#include '/baseHead.ftl'>

<!--主要部分开始-->
<section id="main"><div class="bgA_01">
	
	<div class="userNavPanel_03"><div class="bgP_01">
		<#include 'setting.ftl'>
	</div></div>
	
	<div class="userSetupPanel_01"><!--这个功能块里的button标签可根据需要在 span button a 三种标签中调换-->
		<div class="listField">
			<dl>
				<dt>手机/邮箱:</dt>
				<dd>${viewMember.loginName!}</dd>
				<dd>
					<!--<a href="#" class="link link1" title="点击更改">更改</a>-->
				
				</dd>
			</dl>
			<dl>
				<dt>昵称：</dt>
				<dd><input type="text" id="nickName"  class="txt" value="${viewMember.nickName!}"></dd>
				<dd><em>昵称最长不超过16个字符</em></dd>
			</dl>
			<dl>
				<dt>性别：</dt>
				<dd><select class="select" id="sex">
					<option value="">请选择</option><option <#if viewMember.sex=='m'>selected</#if> value="m">男</option><option <#if viewMember.sex=='w'>selected</#if> value="w">女</option></select></dd>
			</dl>
			<dl>
				<dt>生日：</dt>
				<dd><select class="select" id="birthYear">
						<#list yearList as year>
							<option <#if  year== viewMember.birthYear>selected</#if>>${year?c}</option>
						</#list>  
					</select> 年
					 <select class="select" id="birthMonth">
					 	<#list monthList as month> 
							<option <#if  month== ( viewMember.birthMonth) >selected</#if>>${month}</option>
						</#list>
					 </select> 月 
					 <select class="select" id="birthDay">
						<#list dayList as day>
							<option <#if  day== ( viewMember.birthDay) >selected</#if>>${day}</option>
						</#list>
					 	
					 </select> 日</dd>
			</dl>
			<!--
			<dl>
				<dt>所在地：</dt>
				<dd><select class="select"><option>请选择</option><option>上海</option><option>北京</option></select> <select class="select"><option>请选择</option><option>徐汇区</option><option>虹口区</option></select></dd>
			</dl>
			-->
			<dl>
				<dt>签名：</dt>
				<dd><textarea class="textArea" id="signature" name="signature">${viewMember.signature!}</textarea></dd>
				<dd>最多50个字符</dd>
			</dl>
		</div>
		<div class="submitField">
			<button class="btn btn1" onclick='submit();'>保存资料</button>
			<!--<button class="btn btn1" title="取消">取消</button>-->
		</div>
	</div>
	
				
<#include '/commonFriendLink.ftl'>
	<!--<iframe src="/freemarker/setpage/choosehead.html" name="if1" id="if1" scrolling="no" width="600" height="250" frameborder="0"></iframe>-->

</div></section>
<!--主要部分结束-->
<#include '/baseFoot.ftl'>
<script>
function submit(){
var sex =  $('#sex').val() ;
	if ( sex == ""){
		alert("您不会是外星人吧..性别总该选选啊！");
		return ;
	}
	var nickName =  $('#nickName').val() ;
	if ( nickName == ""){
		alert("咋滴想做坏事不留名?");
		return ;
	}else if ( nickName.length>30){
		alert("昵称太长不利于阅读");
			return ;
	}
	var  signature =$('#signature').val();
	if ( signature.length > 50 ){
		alert("签名过长,最多50个字符");
		return;
	}
	$.ajax({
		 			type: "get",
					url: "${ctx}/member/memberinfoaction",
					beforeSend: function(XMLHttpRequest){
					//ShowLoading();
					},
					success: function(data, textStatus){
						alert(data.desc);
						window.location.reload();
					},
					data:{
						"nickName":nickName,
						"signature":signature,
						"sex":$('#sex').val(),
						"birthYear":$('#birthYear').val(),
						"birthDay":$('#birthDay').val(),
						"birthMonth":$('#birthMonth').val()
					},
					dataType:'json'
				}
	 		)
}
</script>